home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLINC.PAK / GROUPBOX.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  114 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1991, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.5  $
  6. //
  7. // Definition of class TGroupBox.  This defines the basic behavior for all
  8. // group boxes.
  9. //----------------------------------------------------------------------------
  10. #if !defined(OWL_GROUPBOX_H)
  11. #define OWL_GROUPBOX_H
  12.  
  13. #if !defined(OWL_CONTROL_H)
  14. # include <owl/control.h>
  15. #endif
  16.  
  17. #if defined(BI_NAMESPACE)
  18. namespace OWL {
  19. #endif
  20.  
  21. // Generic definitions/compiler options (eg. alignment) preceeding the 
  22. // definition of classes
  23. #include <services/preclass.h>
  24.  
  25. //
  26. // class TGroupBox
  27. // ~~~~~ ~~~~~~~~~
  28. class _OWLCLASS TGroupBox : public TControl {
  29.   public:
  30.     TGroupBox(TWindow*        parent,
  31.               int             id,
  32.               const char far* text,
  33.               int X, int Y, int W, int H,
  34.               TModule*        module = 0);
  35.  
  36.     TGroupBox(TWindow* parent, int resourceId, TModule* module = 0);
  37.  
  38.     // Returns the length of the control's text
  39.     //
  40.     int   GetTextLen();
  41.  
  42.     // Fills the given string with the text of the control.  Returns the
  43.     // number of characters copied.
  44.     // Sets the contents of the associated static text control to the given
  45.     // string
  46.     //
  47.     int   GetText(char far* str, int maxChars);
  48.     void  SetText(const char far* str);
  49.  
  50.     virtual void SelectionChanged(int controlId);
  51.  
  52.     bool   GetNotifyParent() const;
  53.     void   SetNotifyParent(bool notifyparent);
  54.  
  55.   protected:
  56.     char far*    GetClassName();
  57.  
  58.   public_data:
  59.     bool  NotifyParent;
  60.  
  61.   private:
  62.     // Hidden to prevent accidental copying or assignment
  63.     //
  64.     TGroupBox(const TGroupBox&);
  65.     TGroupBox& operator =(const TGroupBox&);
  66.  
  67.   DECLARE_STREAMABLE(_OWLCLASS, TGroupBox, 1);
  68. };
  69.  
  70. // Generic definitions/compiler options (eg. alignment) following the 
  71. // definition of classes
  72. #include <services/posclass.h>
  73.  
  74. #if defined(BI_NAMESPACE)
  75. } // namespace OWL
  76. #endif
  77.  
  78. //----------------------------------------------------------------------------
  79. // Inline implementations
  80. //
  81.  
  82. //
  83. inline int TGroupBox::GetTextLen() {
  84.   return ::GetWindowTextLength(GetHandle());
  85. }
  86.  
  87. //
  88. inline int TGroupBox::GetText(char far* str, int maxChars) {
  89.   return ::GetWindowText(GetHandle(), str, maxChars);
  90. }
  91.  
  92. //
  93. inline void TGroupBox::SetText(const char far* str) {
  94.   ::SetWindowText(GetHandle(), str);
  95. }
  96.  
  97. //
  98. // Return the flag that indicates whether the parent is notified or not.
  99. //
  100. inline bool TGroupBox::GetNotifyParent() const
  101. {
  102.   return NotifyParent;
  103. }
  104.  
  105. //
  106. // Set the flag that indicates whether the parent is notified or not.
  107. //
  108. inline void TGroupBox::SetNotifyParent(bool notifyparent)
  109. {
  110.   NotifyParent = notifyparent;
  111. }
  112.  
  113. #endif  // OWL_GROUPBOX_H
  114.